package cn.bincker.mybatis.encrypt;

import cn.bincker.mybatis.encrypt.converter.EncryptConvertRegister;
import cn.bincker.mybatis.encrypt.core.EncryptCacheManager;
import cn.bincker.mybatis.encrypt.core.EncryptExecutor;
import cn.bincker.mybatis.encrypt.core.EncryptKeyProvider;
import cn.bincker.mybatis.encrypt.core.Encryptor;
import cn.bincker.mybatis.encrypt.core.impl.DefaultEncryptExecutor;

public interface MybatisEncryptConfigurer {
    Encryptor getEncryptor();
    EncryptKeyProvider getEncryptKeyProvider();
    default EncryptExecutor getEncryptExecutor(EncryptConvertRegister convertRegister, EncryptCacheManager encryptCacheManager){
        return new DefaultEncryptExecutor(getEncryptor(), convertRegister, getEncryptKeyProvider(), encryptCacheManager);
    }
}
